package edu.ccut.titan.tag.chart.utils;

import java.awt.Color;
import java.awt.Paint;
import java.util.List;

public class SubAixs {
	
	private String name;
	
	private List<List<?>> datas;
	
	private String color;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<List<?>> getDatas() {
		return datas;
	}

	public void setDatas(List<List<?>> datas) {
		this.datas = datas;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}
	
	public Paint getColorPaint() {
		return parseToColor(this.color);
	}
	
	private Color parseToColor(String c) {
	    Color convertedColor = Color.BLACK;
	    
	    try {
	        convertedColor = new Color(Integer.parseInt(c, 16));
	    } catch(NumberFormatException e) {
	        // codes to deal with this exception
	    }
	    return convertedColor;
	}

}
